﻿using Models;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IRepository
{
    public interface IUtilRepository
    {
        Area CreateArea(Area obj);
        BaseData CreateBaseData(BaseData obj);
        EventLog CreateEventLog(EventLog obj);
        FileSystem CreateFileSystem(FileSystem obj);
        LifecycleEvent CreateLifecycleEvent(LifecycleEvent obj);
        Money CreateMoney(Money obj);
        MoneyLog CreateMoneyLog(MoneyLog obj);
        Relationship CreateRelationship(Relationship obj);
        School CreateSchool(School obj);
        SeldomUsed CreateSeldomUsed(SeldomUsed obj);
        SpliteWord CreateSpliteWord(SpliteWord obj);
        Validation CreateValidation(Validation obj);
        Area GetArea(int code);
        BaseData GetBaseData(int ruleno);
        EventLog GetEventLog(int id);
        FileSystem GetFileSystem(int fileno);
        LifecycleEvent GetLifecycleEvent(int id);
        Relationship GetRelationship(int id);
        School GetSchool(int schoolno);
        SeldomUsed GetSeldomUsed(int id);
        SpliteWord GetSpliteWord(int id);
        Validation GetValidation(int id);
        IList<Area> ListArea();
        IList<BaseData> ListBaseData();
        IList<EventLog> ListEventLog();
        IList<FileSystem> ListFileSystem();
        IList<LifecycleEvent> ListLifecycleEvent();
        IList<Money> ListMoney();
        IList<MoneyLog> ListMoneyLog();
        IList<Relationship> ListRelationship();
        IList<Relationship> ListRelationship(RelationshipFun type, int toNO);

        IList<School> ListSchool();
        IList<SeldomUsed> ListSeldomUsed();
        IList<SpliteWord> ListSpliteWord();
        IDictionary<string, string> ListWrodToSpliteByType(SpliteWordFun fun);
        IList<Validation> ListValidation();
        void UpdateArea(Area obj);
        void UpdateBaseData(BaseData obj);
        void UpdateEventLog(EventLog obj);
        void UpdateFileSystem(FileSystem obj);
        void UpdateLifecycleEvent(LifecycleEvent obj);
        void UpdateMoney(Money obj);
        void UpdateMoneyLog(MoneyLog obj);
        void UpdateRelationship(Relationship obj);
        void UpdateSchool(School obj);
        void UpdateSeldomUsed(SeldomUsed obj);
        void UpdateSpliteWord(SpliteWord obj);
        void UpdateValidation(Validation obj);
        IList<SeldomUsed> ListSeldomUsed(int belongID, SeldomType type, APPRole role);

        IList<FileSystem> ListFileSystem(FileType type, int belongno);
        void CreateUserMessage(UserMessage obj);
        void UpdateUserMessage(UserMessage obj);
        JObject ListUserMessage(string userNo, int start, int limit);
        UserMessage GetUserMessage(int id);
        JObject ListEventLog(IDictionary<SearchKey, string> dicCondition, int start, int limit);
    }
}
